/*
 * XML Type:  Balance
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.Balance
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML Balance(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class BalanceImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.Balance
{
    
    public BalanceImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName NAME$0 = 
        new javax.xml.namespace.QName("", "NAME");
    private static final javax.xml.namespace.QName DESC$2 = 
        new javax.xml.namespace.QName("", "DESC");
    private static final javax.xml.namespace.QName BALTYPE$4 = 
        new javax.xml.namespace.QName("", "BALTYPE");
    private static final javax.xml.namespace.QName VALUE$6 = 
        new javax.xml.namespace.QName("", "VALUE");
    private static final javax.xml.namespace.QName DTASOF$8 = 
        new javax.xml.namespace.QName("", "DTASOF");
    private static final javax.xml.namespace.QName CURRENCY$10 = 
        new javax.xml.namespace.QName("", "CURRENCY");
    
    
    /**
     * Gets the "NAME" element
     */
    public java.lang.String getNAME()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NAME$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "NAME" element
     */
    public net.ofx.types.x2003.x04.GenericNameType xgetNAME()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(NAME$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "NAME" element
     */
    public void setNAME(java.lang.String name)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NAME$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(NAME$0);
            }
            target.setStringValue(name);
        }
    }
    
    /**
     * Sets (as xml) the "NAME" element
     */
    public void xsetNAME(net.ofx.types.x2003.x04.GenericNameType name)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GenericNameType target = null;
            target = (net.ofx.types.x2003.x04.GenericNameType)get_store().find_element_user(NAME$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.GenericNameType)get_store().add_element_user(NAME$0);
            }
            target.set(name);
        }
    }
    
    /**
     * Gets the "DESC" element
     */
    public java.lang.String getDESC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DESC$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "DESC" element
     */
    public net.ofx.types.x2003.x04.ShortMessageType xgetDESC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.ShortMessageType target = null;
            target = (net.ofx.types.x2003.x04.ShortMessageType)get_store().find_element_user(DESC$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "DESC" element
     */
    public void setDESC(java.lang.String desc)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DESC$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DESC$2);
            }
            target.setStringValue(desc);
        }
    }
    
    /**
     * Sets (as xml) the "DESC" element
     */
    public void xsetDESC(net.ofx.types.x2003.x04.ShortMessageType desc)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.ShortMessageType target = null;
            target = (net.ofx.types.x2003.x04.ShortMessageType)get_store().find_element_user(DESC$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.ShortMessageType)get_store().add_element_user(DESC$2);
            }
            target.set(desc);
        }
    }
    
    /**
     * Gets the "BALTYPE" element
     */
    public net.ofx.types.x2003.x04.BalanceEnum.Enum getBALTYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BALTYPE$4, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.BalanceEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "BALTYPE" element
     */
    public net.ofx.types.x2003.x04.BalanceEnum xgetBALTYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BalanceEnum target = null;
            target = (net.ofx.types.x2003.x04.BalanceEnum)get_store().find_element_user(BALTYPE$4, 0);
            return target;
        }
    }
    
    /**
     * Sets the "BALTYPE" element
     */
    public void setBALTYPE(net.ofx.types.x2003.x04.BalanceEnum.Enum baltype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BALTYPE$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(BALTYPE$4);
            }
            target.setEnumValue(baltype);
        }
    }
    
    /**
     * Sets (as xml) the "BALTYPE" element
     */
    public void xsetBALTYPE(net.ofx.types.x2003.x04.BalanceEnum baltype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BalanceEnum target = null;
            target = (net.ofx.types.x2003.x04.BalanceEnum)get_store().find_element_user(BALTYPE$4, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BalanceEnum)get_store().add_element_user(BALTYPE$4);
            }
            target.set(baltype);
        }
    }
    
    /**
     * Gets the "VALUE" element
     */
    public java.lang.String getVALUE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(VALUE$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "VALUE" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetVALUE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(VALUE$6, 0);
            return target;
        }
    }
    
    /**
     * Sets the "VALUE" element
     */
    public void setVALUE(java.lang.String value)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(VALUE$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(VALUE$6);
            }
            target.setStringValue(value);
        }
    }
    
    /**
     * Sets (as xml) the "VALUE" element
     */
    public void xsetVALUE(net.ofx.types.x2003.x04.AmountType value)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(VALUE$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(VALUE$6);
            }
            target.set(value);
        }
    }
    
    /**
     * Gets the "DTASOF" element
     */
    public java.lang.String getDTASOF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DTASOF$8, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "DTASOF" element
     */
    public net.ofx.types.x2003.x04.DateTimeType xgetDTASOF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.DateTimeType target = null;
            target = (net.ofx.types.x2003.x04.DateTimeType)get_store().find_element_user(DTASOF$8, 0);
            return target;
        }
    }
    
    /**
     * True if has "DTASOF" element
     */
    public boolean isSetDTASOF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DTASOF$8) != 0;
        }
    }
    
    /**
     * Sets the "DTASOF" element
     */
    public void setDTASOF(java.lang.String dtasof)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DTASOF$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DTASOF$8);
            }
            target.setStringValue(dtasof);
        }
    }
    
    /**
     * Sets (as xml) the "DTASOF" element
     */
    public void xsetDTASOF(net.ofx.types.x2003.x04.DateTimeType dtasof)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.DateTimeType target = null;
            target = (net.ofx.types.x2003.x04.DateTimeType)get_store().find_element_user(DTASOF$8, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.DateTimeType)get_store().add_element_user(DTASOF$8);
            }
            target.set(dtasof);
        }
    }
    
    /**
     * Unsets the "DTASOF" element
     */
    public void unsetDTASOF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DTASOF$8, 0);
        }
    }
    
    /**
     * Gets the "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency getCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$10, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "CURRENCY" element
     */
    public boolean isSetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CURRENCY$10) != 0;
        }
    }
    
    /**
     * Sets the "CURRENCY" element
     */
    public void setCURRENCY(net.ofx.types.x2003.x04.Currency currency)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$10, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$10);
            }
            target.set(currency);
        }
    }
    
    /**
     * Appends and returns a new empty "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency addNewCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$10);
            return target;
        }
    }
    
    /**
     * Unsets the "CURRENCY" element
     */
    public void unsetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CURRENCY$10, 0);
        }
    }
}
